Predictive display of thrown projectile

ABSTRACT

Embodiments of this disclosure describe a method and an apparatus for controlling a virtual object to interact with a projectile, and a storage medium, and belong to the field of computer technologies. The method includes: controlling the virtual object to pick up the projectile in a virtual scene; determining a position of the projectile as an initial position, and determining a shooting direction of a camera of the virtual scene as a throwing direction of the projectile; determining a motion trajectory of the projectile according to the initial position, the throwing direction, an initial throwing speed of the projectile, and a motion law of an object under an influence of gravity acceleration, so that the motion trajectory is a curve conforming to the motion law; and displaying, in the virtual scene, the motion trajectory. The determined motion trajectory takes into account the influence of gravity, and conforms to the motion law of an object under the influence of gravity acceleration, so that accuracy is improved, and an effect of simulating a realistic scene can be achieved.

RELATED APPLICATION

This application is a continuation application of the International PCTApplication No. PCT/CN2019/096602, filed with the China NationalIntellectual Property Administration, PRC on Jul. 18, 2019 which claimspriority to Chinese Patent Application No. 201810870034.4, entitled“METHOD AND APPARATUS FOR CONTROLLING VIRTUAL OBJECT TO INTERACT WITHPROJECTILE, AND STORAGE MEDIUM” and filed with the China NationalIntellectual Property Administration, PRC on Aug. 2, 2018, which areincorporated herein by reference in their entireties.

FIELD OF THE TECHNOLOGY

Embodiments of this disclosure relate to the field of computertechnologies, and in particular, to a method, an apparatus, and astorage medium for controlling a virtual object to interact with aprojectile.

BACKGROUND OF THE DISCLOSURE

With rapid development of computer technologies and popularization ofsmart terminals, video games have been widely used. A video game canprovide a virtual scene in which virtual items are displayed. A user maycontrol, through a terminal, a virtual object to interact with thevirtual items. A projectile is a commonly used virtual item. The usermay control the virtual object to pick up the projectile and to performa throwing operation on the projectile.

To help the user to control a motion trajectory of the projectile, afterthe user controls the virtual object to pick up the projectile butbefore the throwing operation is performed on the projectile, theterminal may use a position of the projectile as an initial position ofthe motion trajectory, and use a shooting direction of a camera of thevirtual scene as a throwing direction of the projectile. A ray is drawnfrom the initial position along the throwing direction. An intersectionof the ray and an obstacle in the virtual scene is used as an endposition of the motion trajectory. A straight line connecting theinitial position and the end position is used as the motion trajectoryof the projectile. The motion trajectory may be shown in FIG. 1 .Subsequently, the terminal displays, in the virtual scene, the motiontrajectory, so that the user can learn of the motion trajectory of theprojectile before performing the throwing operation on the projectileand then determine whether to adjust the throwing direction of theprojectile.

In the process of implementing the embodiments of this disclosure, it isfound by the inventor that the related art has at least the followingproblems. In the related art, the influence of gravity on the motiontrajectory of the projectile is not considered, and consequently, thedetermined motion trajectory does not conform to a motion law of anobject under the influence of gravity acceleration. Therefore, accuracyis poor and an effect of simulating a real scene may not be achieved.

SUMMARY

Embodiments of this disclosure provide a method and an apparatus forcontrolling a virtual object to interact with a projectile, and astorage medium, to resolve a problem of poor accuracy of a motiontrajectory in the related art. In this disclosure, a projectile isreferred to as any object that may be thrown, such as a grenade, agasoline bomb, a shock bomb, a rock, a missile, or the like. Thetechnical solutions are as follows:

According to an aspect, a method for controlling a virtual object tointeract with a projectile is provided. The method includes:

controlling the virtual object to pick up the projectile in a virtualscene;

determining a position of the projectile as an initial position, anddetermining a shooting direction of a camera of the virtual scene as athrowing direction of the projectile;

determining a motion trajectory of the projectile according to theinitial position, the throwing direction, an initial throwing speed ofthe projectile, and a motion law of an object under an influence ofgravity acceleration, so that the motion trajectory is a curveconforming to the motion law; and

displaying, in the virtual scene, the motion trajectory.

According to an aspect, an apparatus for controlling a virtual object tointeract with a projectile is provided. The apparatus includes:

a pickup module, configured to control the virtual object to pick up theprojectile in a virtual scene;

a parameter determining module, configured to determine a position ofthe projectile as an initial position, and determine a shootingdirection of a camera of the virtual scene as a throwing direction ofthe projectile;

a trajectory determining module, configured to determine a motiontrajectory of the projectile according to the initial position, thethrowing direction, an initial throwing speed of the projectile, and amotion law of an object under the influence of gravity acceleration, sothat the motion trajectory is a curve conforming to the motion law; and

a display module, configured to display, in the virtual scene, themotion trajectory.

According to an aspect, a terminal for controlling a virtual object tointeract with a projectile is provided. The terminal includes aprocessor and a memory. The memory stores at least one instruction, atleast one program, a code set, or an instruction set. The instruction,the program, the code set, or the instruction set is loaded by theprocessor to implement the following operations:

controlling the virtual object to pick up the projectile in a virtualscene;

determining a position of the projectile as an initial position, anddetermining a shooting direction of a camera of the virtual scene as athrowing direction of the projectile;

determining a motion trajectory of the projectile according to theinitial position, the throwing direction, an initial throwing speed ofthe projectile, and a motion law of an object under the influence ofgravity acceleration, so that the motion trajectory is a curveconforming to the motion law; and

displaying, in the virtual scene, the motion trajectory.

According to an aspect, a computer-readable storage medium is provided.The computer-readable storage medium stores at least one instruction, atleast one program, a code set, or an instruction set. The instruction,the program, the code set, or the instruction set is loaded by aprocessor and has operations to implement the method for controlling avirtual object to interact with a projectile.

The technical solutions provided in the embodiments of this disclosurehave at least the following beneficial effects:

According to the method, the apparatus, and the storage medium providedin the embodiments of this disclosure, the virtual object is controlledto pick up the projectile in the virtual scene, the position of theprojectile is determined as the initial position, and the shootingdirection of the camera of the virtual scene is determined as thethrowing direction of the projectile; according to the initial position,the throwing direction, the initial throwing speed of the projectile,and the motion law of an object under the influence of gravityacceleration, the motion trajectory of the projectile is determined, sothat the motion trajectory is a curve conforming to the motion law; andthe motion trajectory is displayed in the virtual scene. The determinedmotion trajectory takes into account the influence of gravity, andconforms to the motion law of an object under the influence of gravityacceleration, so that accuracy is improved, and an effect of simulatinga real scene can be achieved.

In addition, a plurality of preset moments are obtained and positions ofthe projectile at the preset moments are compared, so that a positionwhere the projectile first hits an obstacle is determined as an endposition of the motion trajectory. An accurate end position of themotion trajectory can be determined, and an effect of a thrown objecthitting the obstacle can be simulated, making the scene more realisticand vivid.

In addition, when a user performs a direction adjustment operation, thethrowing direction of the projectile can be adjusted according to thedirection adjustment operation, and the motion trajectory of theprojectile can be further adjusted, so that flexible adjustment of themotion trajectory is implemented and requirements of a user can be met.

BRIEF DESCRIPTION OF THE DRAWINGS

To describe the technical solutions of the embodiments of thisdisclosure more clearly, the following briefly describes theaccompanying drawings required for describing the embodiments.Apparently, the accompanying drawings in the following description showonly some embodiments of this disclosure, and a person of ordinary skillin the art may still derive other accompanying drawings from theaccompanying drawings without creative efforts.

FIG. 1 is a schematic diagram of a motion trajectory of a projectileaccording to the related art.

FIG. 2 is a schematic diagram of a virtual scene according to anembodiment of this disclosure.

FIG. 3 is a flowchart of a method for controlling a virtual object tointeract with a projectile according to an embodiment of thisdisclosure.

FIG. 4 is a schematic diagram of a pickup button according to anembodiment of this disclosure.

FIG. 5 is a schematic vector diagram of a shooting direction of a cameraaccording to an embodiment of this disclosure.

FIG. 6 is a schematic diagram of adjusting a shooting direction of acamera according to an embodiment of this disclosure.

FIG. 7 is a schematic diagram of a throw button according to anembodiment of this disclosure.

FIG. 8 is a schematic diagram of a motion trajectory and an end positionthereof according to an embodiment of this disclosure.

FIG. 9 is a schematic diagram of prompt information of a directionadjustment operation according to an embodiment of this disclosure.

FIG. 10 is a schematic diagram of an adjusted motion trajectoryaccording to an embodiment of this disclosure.

FIG. 11 is a schematic diagram of an operation process according to anembodiment of this disclosure.

FIG. 12 is a schematic structural diagram of an apparatus forcontrolling a virtual object to interact with a projectile according toan embodiment of this disclosure.

FIG. 13 is a schematic structural diagram of a terminal according to anembodiment of this disclosure.

DESCRIPTION OF EMBODIMENTS

The following clearly and comprehensively describes the technicalsolutions in the embodiments of this disclosure with reference to theaccompanying drawings in the embodiments of this disclosure. Apparently,the described embodiments are some of embodiments of this disclosurerather than all of the embodiments. All other embodiments obtained by aperson of ordinary skill in the art based on the embodiments of thisdisclosure without creative efforts shall fall within the protectionscope of this application.

First, terms described in the embodiments of this disclosure areintroduced as follows:

A virtual scene is a virtual environment displayed (or provided) when anapplication program is running on a terminal. The virtual environmentmay be a simulated environment of a real world, or may be asemi-simulated semi-fictional environment, or may be an entirelyfictional environment. The virtual scene may be a two-dimensionalvirtual scene, or may be a three-dimensional virtual scene.

For example, the virtual scene may include the sky, the land, and theocean, and the land may include environment elements such as a desertand cities. The virtual scene may further be used for simulating a realenvironment under a different weather, for example, a sunny day, a rainyday, a foggy day, or a dark night. The virtual scene may further includea virtual item. A virtual object may pick up the virtual item, throw thepicked-up virtual item, or discard the picked-up virtual item.

A virtual object is a movable three-dimensional model in the virtualscene, and may be used for representing an image of a user. The virtualobject may be in any form such as a virtual character, a virtual animal,and a cartoon character, for example, a character or an animal displayedin the virtual scene. Optionally, the virtual object may be athree-dimensional model created based on an animation skeletontechnology in a three-dimensional virtual scene. Each virtual object hasa shape and a volume in the three-dimensional virtual scene, andoccupies some space in the three-dimensional virtual scene.

A virtual item is an item arranged in the virtual scene, and may bepicked up, thrown or discarded by the virtual object. For example, thevirtual item may be a piece of clothing, a helmet, a body armor, amedical product, a cold weapon or hot weapon, and the like, or may be athrowable projectile such as a grenade, a gasoline bomb, or a shockbomb.

A camera is a three-dimensional model located around the virtual objectin the virtual scene. When a first-person viewing angle is used, thecamera may be located around the head of the virtual object or in thehead of the virtual object; when a third-person viewing angle is used,the camera may be located in rear of the virtual object, and the virtualscene is observed from a viewing angle of the camera.

A shooting direction of the camera is an observation direction whenobservation is performed from a first-person viewing angle or athird-person viewing angle of a virtual object in a virtual scene.

The terminal may use the first-person viewing angle for display. Thedisplayed virtual scene includes only hands and arms of the virtualobject, or a weapon held by the virtual object, to simulate an effect ofobserving the virtual scene through a viewing angle of the virtualobject. Alternatively, the terminal may use the third-person viewingangle for display. The third-person viewing angle may be in the samedirection as the first-person viewing angle, while in the third-personviewing angle, the virtual object facing away from the terminal screenis displayed in the virtual scene, so that the user can see actions andan environment of the controlled virtual object in the virtual scene.

The embodiments of this disclosure mainly relate to video games, forexample, first-person shooter (FPS) games, real-time strategy (RTS)games, or multiplayer online battle arena (MOBA) games. The terminal maydownload and install a configuration file of a video game. Theconfiguration file includes an application program, interface displaydata, or virtual scene data of the video game. When the user logs in tothe video game on the terminal, the terminal renders and displays thevirtual scene in the video game by invoking the configuration file. Theuser may perform a control operation on the terminal. After detectingthe control operation, the terminal may determine game datacorresponding to the control operation, and render and display the gamedata. The game data may include virtual scene data, behavior data of thevirtual object in the virtual scene, and the like.

The user may control, through control operation, the virtual object tomove in the virtual scene. Using a shooting game as an example, in thevirtual scene, the user may control the virtual object to fall freely,glide, or fall after a parachute is opened in the sky; or to run, jump,creep, stoop and move forward on the land; or control the virtual objectto swim, float, or dive in the ocean. Certainly, the user may furthercontrol the virtual object to ride in a vehicle to move in the virtualscene. The user may further control the virtual object to discover avirtual item in the virtual scene, and to pick up the virtual item inthe virtual scene, to fight against another virtual object using thepicked-up virtual item or to perform a throwing operation on the virtualitem such as a projectile.

The user may control, through the control operation, the virtual objectto rotate, and adjust the shooting direction of the camera, which isequivalent to adjusting a view-angle coverage of the virtual object. Forexample, the control operation may be a sliding operation. Whendetecting the sliding operation, the terminal may determine a rotationdirection, a rotation angle, and a rotation speed of a viewing anglecorresponding to the sliding operation based on a sliding direction, asliding distance, and a sliding speed of the sliding operation. Forexample, the sliding direction of the sliding operation may correspondto the rotation direction of the viewing angle, and the sliding distanceof the sliding operation and the rotation angle of the viewing angle maybe positively correlated. The sliding speed of the sliding operation andthe rotation speed of the viewing angle may be positively correlated.

FIG. 2 is a schematic diagram of a virtual scene according to anembodiment of this disclosure. Referring to FIG. 2 , the terminaldisplays the virtual scene. The virtual scene includes a virtual object,and the virtual object holds a projectile in the hand.

FIG. 3 is a flowchart of a method for controlling a virtual object tointeract with a projectile according to an embodiment of thisdisclosure. The execution subject of this embodiment of this disclosureis a terminal. The terminal may be a device such as a mobile phone, acomputer, a tablet computer, or a smart game console. The terminal canrun an application program that supports a virtual scene. Theapplication program may be a virtual reality application program, athree-dimensional map program, a military simulation game program, a FPSgame program, a MOBA game program, or other application programs, or thelike. Referring to FIG. 3 , the method includes the following steps:

301. A terminal controls a virtual object to pick up a projectile in avirtual scene.

In this embodiment of this disclosure, the terminal displays the virtualscene and displays various elements configured in the virtual scene. Theelements may be environment elements such as sky and land, or virtualitems such as clothing and projectiles. The projectile is a virtual itemthat may be picked up and thrown by the virtual object, such as agrenade, a gasoline bomb, a shock bomb, or the like.

The terminal may obtain configuration data of the virtual items. Theconfiguration data of the virtual items may include types of the virtualitems. For example, the configuration data may define virtual items suchas grenade, gasoline bomb, and shock bomb are types of projectiles. Forsuch projectiles, the terminal may control the virtual object to performat least one of a pickup operation or a throwing operation.

In a possible implementation, referring to FIG. 4 , the terminaldisplays, in the virtual scene, a pickup button of the projectile. Theterminal controls the virtual object to pick up the projectile anddisplays a dynamic image of the virtual object picking up theprojectile, in response to detecting a confirmation operation on thepickup button.

The confirmation operation may be a clicking operation, a long-pressoperation, or the like, on the pickup button. When the terminal displaysthe pickup button, a prompt message may further be displayed to promptthe user to perform the confirmation operation on the pickup button. Forexample, the prompt information is “Click here to hold the projectile inthe hand of the character”.

The projectile that can be picked up by the virtual object may be aprojectile that is owned by the virtual object, or may be a projectilethat is currently located near the virtual object without an owner.

For example, from the perspective of the virtual items, the terminal mayestablish an attribution relationship table. The attributionrelationship table includes virtual objects to which the virtual itemsbelong. From the perspective of the virtual objects, the terminal mayestablish an item library of a virtual object. The virtual itemsbelonging to the virtual object may all be considered to be stored inthe item library.

Then, when the terminal opens the item library of the virtual objectaccording to a user operation, the virtual items belonging to thevirtual object are displayed, and the pickup buttons of the projectilesare displayed. The virtual object is controlled to pick up theprojectile in response to detecting a confirmation operation of the useron the pickup button.

Alternatively, the terminal controls the virtual object to move in thevirtual scene according to a user operation, and displays a virtualscene within a preset range. In a case that a projectile is locatedwithin the preset range and it is determined according to theattribution relationship table that the projectile has no owner, thepickup button of the projectile may be displayed. The virtual object maybe controlled to pick up the projectile in response to detecting theconfirmation operation of the user on the pickup button.

Certainly, this embodiment of this disclosure is described merely byusing picking up one projectile as an example. The item library of thevirtual object or the virtual scene within the preset range may includeone or more projectiles. A picking process of each projectile is similarto that of this projectile, and is not repeated herein.

The dynamic image displaying the virtual object picking up theprojectile may be a dynamic image of the projectile moving into the handof the virtual object, or may be a dynamic image of the virtual objectbending over to pick up the projectile. Thus simulating an effect ofpeople picking up an item in a real scene, making the screen morerealistic and vivid.

302. The terminal determines a position of the projectile as an initialposition, and determines a shooting direction of a camera of the virtualscene as a throwing direction of the projectile.

In the process of controlling the virtual object to pick up theprojectile, the terminal may track the position of the projectileaccording to the displayed dynamic image. After the virtual object picksup the projectile, the position of the projectile is determined as theinitial position of a motion trajectory of the projectile.

Alternatively, the terminal may further determine a position in a presetrelative position relationship with the virtual object as the positionof the projectile, and use this position as the initial position of themotion trajectory of the projectile.

In a possible implementation, the preset relative position relationshipmay be that the projectile is at the position of the virtual object andthat a height of the projectile is a preset value. In this case, theterminal obtains three-dimensional coordinates of the virtual object inthe virtual scene, updates the Z-axis coordinates in thethree-dimensional coordinates to preset values, and determines theupdated three-dimensional coordinates as coordinates of the initialposition. The preset values may be determined according to a height of ahand after people pick up an item under normal circumstances, tosimulate an effect that the projectile is on the virtual object and inthe hand of the virtual object.

Alternatively, the preset relative position relationship may be that theprojectile is on the right rear side of the virtual object, is at apreset angle to the virtual object, is at a preset distance from thevirtual object, and the height of the projectile is a preset value. Inthis case, the terminal obtains the three-dimensional coordinates of thevirtual object in the virtual scene. A projection point of thethree-dimensional coordinates in the horizontal plane is moved to theright rear side according to the preset angle and the preset distance.The X-axis coordinate and Y-axis coordinate of the moved position areused as the X-axis coordinate and Y-axis coordinate of the projectile.The Z-axis coordinate of the projectile is determined as a preset value,to determine the coordinates of the initial position. The preset angleand the preset distance may be determined according to a relativeposition between a hand and a human body after people raise the handunder normal circumstances. The preset value may be determined accordingto the height of the raised hand under normal circumstances, to simulatean effect that the projectile is in the hand of the virtual object andthe virtual object makes a preparation to throw the projectile. Asanother example, the projectile may be on the left rear side of thevirtual object. There is no limitation on the preset relative positionrelationship between the projectile and the virtual object in thisdisclosure.

In another possible implementation, after the terminal controls thevirtual object to pick up the projectile but before the throwing theprojectile, the terminal may further control the virtual object to movein the virtual scene. Then, in a movement process of the virtual object,the position of the projectile may be tracked in real time to determinethe initial position of the motion trajectory of the projectile.Alternatively, after the movement of the virtual object, the position ina preset relative position relationship with the virtual object isdetermined as the position of the projectile, and the position may beused as the initial position of the motion trajectory of the projectile.

In this embodiment of this disclosure, the terminal creates a camera inthe virtual scene to simulate the viewing angle of the virtual object.In a case that a first-person viewing angle is used, the camera may belocated near the head of the virtual object or may be located at thehead of the virtual object. The virtual scene is observed from theshooting direction of the camera, which is equivalent to observing thevirtual scene through the viewing angle of the virtual object. In a casethat a third-person viewing angle is used, the camera may be locatedbehind the virtual object, and the virtual scene is observed from theshooting direction of the camera.

The shooting direction may be represented in the form of a vector.Referring to FIG. 5 , the position of the camera may be used as anorigin of a coordinate system of the camera. The shooting direction ofthe camera may be represented by a vector a horizontally to the right, afront vector b and a vector c vertically upward. That is, (a, b, c)represents a vector of the shooting direction, and the vector is a unitvector, that is, √{square root over (a²+b²+c²)}=1. Motion of the cameramay include: a rotation around the vector a, a rotation around thevector b, a rotation around the vector c, a scan around the vector a,translation around the vector b, or a rise and a fall around the vectorc. For example, referring to FIG. 6 , in a game scene, the terminaldisplays a game screen. When the camera rotates to the left around thevector b, the displayed game screen is switched from a game screen A toa game screen A′, to simulate an effect of the virtual object turninghead.

After the virtual object is controlled to pick up the projectile, it maybe considered that the throwing direction of the projectile isconsistent with the shooting direction of the camera. Therefore, theshooting direction of the camera in the virtual scene is determined asthe throwing direction of the projectile, that is, a moving direction ofthe projectile in the initial position.

303. The terminal determines a motion trajectory of the projectileaccording to the initial position, the throwing direction, an initialthrowing speed of the projectile, and a motion law of an object underthe influence of gravity acceleration, so that the motion trajectory isa curve conforming to the motion law (or law of motion).

First, the initial throwing speed of the projectile may be a presetrate, which, for example, may be determined according to an initial rateof people throwing an object under normal circumstances. If v₀represents the initial throwing speed and (a, b, c) represents thethrowing direction, an initial velocity of the projectile may bedetermined as (v₀a, v₀b, v₀c) according to the initial throwing speedand the throwing direction.

Then, for example, (x₀, y₀, z₀) represents the coordinates of theinitial position, and the initial throwing moment is 0. Assuming thatafter the projectile is thrown, coordinates of the projectile during themotion are (x, y, z) and a corresponding moment is t, g representinggravity acceleration, the following formulas may be determined accordingto the motion law of an object under the influence of gravityacceleration:x=x ₀ +v ₀at  (1);y=y ₀ +v ₀ bt  (2);z=z ₀ +v ₀ ct−½gt ²  (3),

$t = \frac{x - x_{0}}{v_{0}a}$is substituted into the last two formulas (2) and (3) to obtain thefollowing formula:

$\begin{matrix}\{ {\begin{matrix}{{y = {y_{0} + {v_{0}b\frac{x - x_{0}}{v_{0}a}}}}\mspace{155mu}} \\{z = {z_{0} + {v_{0}c\frac{x - x_{0}}{v_{0}a}} - {\frac{1}{2}{g( \frac{x - x_{0}}{v_{0}a} )}^{2}}}}\end{matrix}.}  & (4)\end{matrix}$

That is, the terminal can use the foregoing formula to determine themotion trajectory of the projectile.

Furthermore, it is considered that after the projectile is thrown, ifthe projectile hits an obstacle in the virtual scene during the motion,the projectile stops moving and the motion trajectory is terminated.Therefore, the terminal can use the following steps to determine the endposition of the motion trajectory:

3031. Obtain a plurality of preset moments, a time interval between anytwo adjacent preset moments being a preset duration.

For example, if t represents the preset moment, the preset durationbeing 0.01 seconds, the obtained plurality of preset moments are t=0,t=0.01, t=0.02, and so on. During implementation, the preset durationmay be determined according to requirements of accuracy and algorithmcomplexity.

3032. Determine a position of the projectile at each preset momentaccording to the initial position, the throwing direction, the initialthrowing speed, and the motion law. Then, for each preset moment, theterminal uses the foregoing formulas (1), (2), (3) to calculate the x,y, and z coordinates of the positions of the projectile at thecorresponding preset moments, respectively.

3033. Determine a second position as the end position of the motiontrajectory if a first position of the projectile at a first presetmoment is not within an obstacle area of the virtual scene, and thesecond position of the projectile at a second preset moment is withinthe obstacle area of the virtual scene, the second preset moment being anext moment of the first preset moment.

The terminal may obtain obstacle configuration data of the virtualscene, and the obstacle configuration data includes each obstacle area,such as a ground area, a mountain area, a target area, which are areasincluding various types of obstacles. Then, after the position of theprojectile at each preset moment is calculated, it can be determinedwhether the position is within an obstacle area in the virtual scene. Ifthe position is not within the obstacle area in the virtual scene, itindicates that the projectile is still in motion at the correspondingpreset moment; if the position is within the obstacle area in thevirtual scene, it indicates that the projectile has hit the obstacle andstopped moving at the corresponding preset moment. Therefore, when theterminal determines that the first position of the projectile at thefirst preset moment is not within the obstacle area of the virtual sceneand the second position of the projectile at the second preset moment iswithin the obstacle area of the virtual scene, the second preset momentbeing the next moment of the first preset moment, it indicates that theprojectile hits the obstacle for the first time in the second positionat the second preset moment, then the second position is determined asthe end position of the motion trajectory.

Based on the above description, the terminal may determine the motiontrajectory of the projectile using the following formula:

$\{ {{\begin{matrix}{{y = {y_{0} + {v_{0}b\frac{x - x_{0}}{v_{0}a}}}}\mspace{155mu}} \\{z = {z_{0} + {v_{0}c\frac{x - x_{0}}{v_{0}a}} - {\frac{1}{2}{g( \frac{x - x_{0}}{v_{0}a} )}^{2}}}}\end{matrix}{\min( {x_{0},x_{l}} )}} \leq x \leq {\max( {x_{0},x_{l}} )}} $x_(l) representing a coordinate of the second position on the X axis ofthe virtual scene. That is, the position on the X axis that theprojectile stops moving. A motion trajectory determined in the foregoingmanner is a parabola, and conforms to the motion law of an object underthe influence of gravity acceleration.

304. The terminal displays, in the virtual scene, the motion trajectory,and performs step 305 or 307.

The motion trajectory includes the initial position and the endposition. The terminal may display the motion trajectory from theinitial position to the end position in the virtual scene.

In a possible implementation, after controlling the virtual object topick up the projectile, the terminal may display, in the virtual scene,a throw button of the projectile, and display, in the virtual scene, themotion trajectory in response to detecting a press operation on thethrow button.

For example, after controlling the virtual object to pick up theprojectile, the terminal displays, in the virtual scene, the throwbutton of the projectile, performs the foregoing steps 302 and 303 todetermine the motion trajectory of the projectile, and then displays, inthe virtual scene, the motion trajectory in response to detecting thepress operation on the throw button. Alternatively, after controllingthe virtual object to pick up the projectile, the terminal displays, inthe virtual scene, the throw button of the projectile, performs theforegoing steps 302 and 303 to determine the motion trajectory of theprojectile in response to detecting the press operation on the throwbutton, and displays, in the virtual scene, the motion trajectory.

Referring to FIG. 7 and FIG. 8 , when the user presses the throw buttonon the left, the terminal displays the motion trajectory of theprojectile, and prompts the motion trajectory and the end position. Theuser may check the motion trajectory and learn in advance, according tothe motion trajectory, what the motion trajectory of the projectile islike and where the projectile falls, to learn whether the throwingdirection is correct, and to determine whether to perform the throwingoperation on the projectile or adjust the throwing direction.

305. The terminal adjusts, in response to detecting a directionadjustment operation, the shooting direction of the camera according tothe direction adjustment operation, and determines an adjusted shootingdirection of the camera as an adjusted throwing direction of theprojectile.

When the user hopes to adjust the throwing direction of the projectile,the direction adjustment operation may be performed to adjust theshooting direction of the camera, and the adjusted shooting direction ofthe camera is determined as the adjusted throwing direction of theprojectile.

The terminal may display a viewing angle adjustment control whendisplaying the virtual scene. The user may perform a directionadjustment operation through the viewing angle adjustment control tocontrol the shooting direction of the camera to rotate clockwise orcounterclockwise, to adjust the throwing direction of the projectile.The direction adjustment operation may be a press operation. When theuser performs the press operation on the viewing angle adjustmentcontrol of the terminal, the terminal may determine an adjustment angleof the shooting direction based on a position of the press operation inthe viewing angle adjustment control, and pressing force and pressingtime of the press operation.

Alternatively, the direction adjustment operation may further be arotation or tilt operation on the terminal. For example, when detectingthe rotation operation, the terminal determines the adjustment angle ofthe shooting direction according to a rotation direction, a rotationangle, and a rotation speed of the rotation operation.

Alternatively, the direction adjustment operation may further be asliding operation when pressing the throw button by the user. Whendetecting the sliding operation, the terminal determines the adjustmentangle of the shooting direction according to a sliding direction and asliding distance of the sliding operation. Certainly, the directionadjustment operation may alternatively be another operation such as akey-pressing operation, or a toggle operation on a control deviceconnected to the terminal such as a joystick.

306. The terminal redetermines the motion trajectory of the projectileaccording to the initial position, the adjusted throwing direction, theinitial throwing speed, and the motion law, and displays, in the virtualscene, a redetermined motion trajectory.

After adjusting the throwing direction, the terminal redetermines themotion trajectory of the projectile and displays the redetermined motiontrajectory in a manner similar to that of the foregoing step 303according to the adjusted throwing direction.

Referring to FIG. 9 , in a case that the user presses the throw button,the terminal displays the motion trajectory of the projectile, anddisplays prompt information “Slide the blank area on the right side ofthe screen” to prompt the user to adjust the throwing direction. Whenthe user slides to the left on the display, the camera rotates to theleft, and a virtual scene taken after the rotation and the redeterminedmotion trajectory that are shown in FIG. 10 are displayed. It can beseen from comparison between FIG. 9 and FIG. 10 that the screen of thevirtual scene moves to the left, and the end position of the motiontrajectory also moves to the left.

307. The terminal controls the virtual object to perform a throwingoperation on the projectile and displays a dynamic image of theprojectile moving to the end position of the motion trajectory along themotion trajectory.

Based on the foregoing possible implementation of step 304, the terminaldisplays, in the virtual scene, the motion trajectory in response todetecting the press operation on the throw button. When determining thatthe motion trajectory meets a requirement, the user may release thethrow button. The terminal controls the virtual object to perform thethrowing operation on the projectile and displays the dynamic image ofthe projectile moving to the end position of the motion trajectory alongthe motion trajectory, in response to detecting a release operation onthe throw button.

In addition, when the projectile reaches the end position, a dynamicimage of the projectile acting on the obstacle may further be displayed.For example, if the projectile is a grenade, when the grenade reaches aposition on a ground, a dynamic image of the grenade exploding isdisplayed in the position.

Step 307 may be performed after step 304, or may be performed after step306. This may be determined according to whether the user performs adirection adjustment operation. Alternatively, the terminal may furtherperform step 307 in other cases. For example, the terminal automaticallyperforms step 307 after the terminal displays that the motion trajectoryis completed, or automatically performs step 307 when it is detectedthat the virtual object is attacked by another virtual object.

According to the method provided in this embodiment of this disclosure,the virtual object is controlled to pick up the projectile in thevirtual scene. The position of the projectile is determined as theinitial position, and the shooting direction of the camera of thevirtual scene is determined as the throwing direction of the projectile.According to the initial position, the throwing direction, the initialthrowing speed of the projectile, and the motion law of an object underthe influence of gravity acceleration, the motion trajectory of theprojectile is determined, so that the motion trajectory is a curveconforming to the motion law, and the motion trajectory is displayed inthe virtual scene. The determined motion trajectory takes into accountthe influence of gravity, and conforms to the motion law of an objectunder the influence of gravity acceleration, so that accuracy isimproved, and an effect of simulating a real scene can be achieved.

In addition, a plurality of preset moments are obtained and positions ofthe projectile at the preset moments are compared, so that a positionwhere the projectile first hits an obstacle is determined as an endposition of the motion trajectory. An accurate end position of themotion trajectory can be determined, and an effect of a thrown objecthitting the obstacle can be simulated, making the scene more real andvivid.

In addition, when a user performs a direction adjustment operation, thethrowing direction of the projectile can be adjusted according to thedirection adjustment operation, and the motion trajectory of theprojectile can be further adjusted, so that flexible adjustment of themotion trajectory is implemented and requirements of a user can be met.

FIG. 11 is a schematic diagram of an operation process according to anembodiment of this disclosure. Referring to FIG. 11 , the operationprocess includes the following steps:

1101. A terminal displays a pickup button of a projectile, and after auser clicks a pickup button, the terminal controls a virtual object tohold the projectile in the hand.

1102. The terminal displays a throw button of the projectile, and afterthe user presses the throw button, the terminal displays a dynamic imageof the virtual object preparing to throw the projectile, then invokes ashooting direction of a camera to determine a motion trajectory of theprojectile, and displays the motion trajectory.

1103. The user performs a sliding operation on a blank area on the rightside of a display, and the terminal adjusts the shooting direction ofthe camera according to the sliding operation, to further adjust athrowing direction of the projectile, to redetermine the motiontrajectory, and displays the redetermined motion trajectory.

1104. After the user releases the throw button, the terminal controlsthe virtual object to throw the projectile and displays a dynamic imageof the projectile moving to an end position along the motion trajectory.

This embodiment of this disclosure provides a method for determining themotion trajectory. According to the method, the motion trajectory andthe end position of the projectile may be presented in the virtual sceneby drawing lines in advance, so that the user may predict in advance themotion trajectory of the projectile when performing the throwingoperation on the projectile according to a current throwing direction.In addition, the user may further adjust the throwing direction andchange the motion trajectory and the end position of the projectile.

FIG. 12 is a schematic structural diagram of an apparatus forcontrolling a virtual object to interact with a projectile according toan embodiment of this disclosure. Referring to FIG. 12 , the apparatusis applied to a terminal and includes:

a pickup module 1201, configured to perform the step of controlling thevirtual object to pick up the projectile in a virtual scene in theforegoing embodiment;

a parameter determining module 1202, configured to perform the step ofdetermining an initial position and a throwing direction in theforegoing embodiment;

a trajectory determining module 1203, configured to perform the step ofdetermining a motion trajectory of the projectile according to theinitial position, the throwing direction, an initial throwing speed ofthe projectile, and a motion law of an object under the influence ofgravity acceleration in the foregoing embodiment; and

a display module 1204, configured to perform the step of displaying themotion trajectory in the virtual scene in the foregoing embodiment.

Optionally, the trajectory determining module 1203 is further configuredto perform the step of determining the motion trajectory of theprojectile using the following formula in the foregoing embodiment:

$\{ {{\begin{matrix}{{y = {y_{0} + {v_{0}b\frac{x - x_{0}}{v_{0}a}}}}\mspace{155mu}} \\{z = {z_{0} + {v_{0}c\frac{x - x_{0}}{v_{0}a}} - {\frac{1}{2}{g( \frac{x - x_{0}}{v_{0}a} )}^{2}}}}\end{matrix}{\min( {x_{0},x_{l}} )}} \leq x \leq {{\max( {x_{0},x_{l}} )}.}} $

Optionally, the apparatus further includes:

a moment determining module, configured to perform the step of obtaininga plurality of preset moments in the foregoing embodiment;

a position determining module, configured to perform the step ofdetermining a position of the projectile at each preset moment accordingto the initial position, the throwing direction, the initial throwingspeed, and the motion law in the foregoing embodiment; and

an end position determining module, configured to perform the step ofdetermining a second position as the end position of the motiontrajectory if a first position of the projectile at a first presetmoment is not within an obstacle area of the virtual scene and thesecond position of the projectile at a second preset moment is withinthe obstacle area of the virtual scene in the foregoing embodiment.

Optionally, the display module 1204 includes:

a button display unit, configured to perform the step of displaying, inthe virtual scene, a throw button of the projectile in the foregoingembodiment; and

a trajectory display unit, configured to perform the step of displaying,in the virtual scene, the motion trajectory, in response to detecting apress operation on the throw button in the foregoing embodiment.

Optionally, the display module 1204 further includes:

a throwing operation module, configured to perform the step ofcontrolling the virtual object to perform a throwing operation on theprojectile and displaying a dynamic image of the projectile moving tothe end position of the motion trajectory along the motion trajectory,in response to detecting a release operation on the throw button in theforegoing embodiment.

When the apparatus for controlling a virtual object to interact with aprojectile provided in the foregoing embodiment controls the virtualobject to interact with the projectile, only division of the foregoingfunctional modules is used as an example for description. In thepractical application, the functions may be allocated to and completedby different functional modules according to requirements. That is, aninternal structure of the terminal is divided into different functionalmodules, to complete all or some of the functions described above. Inaddition, the apparatus for controlling a virtual object to interactwith a projectile provided in the foregoing embodiment and the methodembodiment for controlling a virtual object to interact with aprojectile belong to the same concept. For a specific implementationprocess of the apparatus, refer to the method embodiment for details.Details are not described herein again.

FIG. 13 is a structural block diagram of a terminal 1300 according to anexemplary embodiment of this disclosure. The terminal 1300 may be aportable mobile terminal, for example, a smartphone, a tablet computer,a Moving Picture Experts Group Audio Layer III (MP3) player, a MovingPicture Experts Group Audio Layer IV (MP4) player, a notebook computer,or a desktop computer. The terminal 1300 may also be referred to asanother name such as user equipment, a portable terminal, a laptopterminal, or a desktop terminal.

Generally, the terminal 1300 includes a processor 1301 and a memory1302.

The processor 1301 may include one or more processing cores, forexample, a 4-core processor or an 8-core processor. The processor 1301may be implemented by using at least one hardware form of digital signalprocessing (DSP), a field-programmable gate array (FPGA), and aprogrammable logic array (PLA). The processor 1301 may alternativelyinclude a main processor and a coprocessor. The main processor isconfigured to process data in an awake state, also referred to as acentral processing unit (CPU), and the coprocessor is a low-powerprocessor configured to process data in a standby state. In someembodiments, the processor 1301 may be integrated with a graphicsprocessing unit (GPU). The GPU is configured to be responsible forrendering and drawing content that a display needs to display. In someembodiments, the processor 1301 may further include an artificialintelligence (AI) processor. The AI processor is configured to process acalculation operation related to machine learning.

The memory 1302 may include one or more non-transitory computer-readablestorage media. The non-transitory computer-readable storage medium maybe non-transient. The memory 1302 may further include a high-speedrandom access memory and a non-volatile memory such as one or moremagnetic disk storage devices and a flash storage device. In someembodiments, the non-transitory computer-readable storage medium in thememory 1302 is configured to store at least one instruction. The atleast one instruction is executed by the processor 1301 to implement themethod for controlling a virtual object to interact with a projectileprovided in the method embodiment in this application.

In some embodiments, the terminal 1300 may further optionally include aperipheral device interface 1303 and at least one peripheral device. Theprocessor 1301, the memory 1302, and the peripheral device interface1303 may be connected through a bus or a signal cable. Each peripheraldevice may be connected to the peripheral device interface 1303 througha bus, a signal cable, or a circuit board. Specifically, the peripheraldevice includes: at least one of a radio frequency circuit 1304, a touchdisplay 1305, a camera assembly 1306, an audio circuit 1307, apositioning component 1308, and a power supply 1309.

The peripheral device interface 1303 may be configured to connect atleast one peripheral device related to input/output (I/O) to theprocessor 1301 and the memory 1302. In some embodiments, the processor1301, the memory 1302, and the peripheral device interface 1303 areintegrated into a same chip or circuit board; in some other embodiments,any one or two of the processor 1301, the memory 1302, and theperipheral device interface 1303 may be implemented on an independentchip or circuit board. This is not limited in this embodiment.

The radio frequency circuit 1304 is configured to receive and transmit aradio frequency (RF) signal, also referred to as an electromagneticsignal. The radio frequency circuit 1304 communicates with acommunications network and another communications device by using theelectromagnetic signal. The radio frequency circuit 1304 may convert anelectric signal into an electromagnetic signal for transmission, orconvert a received electromagnetic signal into an electric signal.Optionally, the radio frequency circuit 1304 includes: an antennasystem, an RF transceiver, one or more amplifiers, a tuner, anoscillator, a digital signal processor, a codec chip set, a subscriberidentity module card, and the like. The radio frequency circuit 1304 maycommunicate with another terminal through at least one wirelesscommunication protocol. The wireless communication protocol includes,but is not limited to: a metropolitan area network, generations ofmobile communication networks (2G, 3G, 4G, and 5G), a wireless localarea network and/or a wireless fidelity (Wi-Fi) network. In someembodiments, the radio frequency circuit 1304 may further include a nearfield communication (NFC) related circuit, and is not limited in thisapplication.

The display 1305 is configured to display a user interface (UI). The UImay include a graph, a text, an icon, a video, and any combinationthereof. When the display 1305 is a touch display, the display 1305 isfurther capable of acquiring a touch signal on or above a surface of thedisplay 1305. The touch signal may be input to the processor 1301 forprocessing as a control signal. In this case, the touch display 1305 maybe further configured to provide a virtual button and/or a virtualkeyboard, which is also referred to as a soft button and/or a softkeyboard. In some embodiments, there may be one touch display 1305,disposed on a front panel of the terminal 1300. In some otherembodiments, there may be at least two touch displays 1305, disposed ondifferent surfaces of the terminal 1300 respectively or in a foldeddesign. In still other embodiments, the touch display 1305 may be aflexible display, disposed on a curved surface or a folded surface ofthe terminal 1300. Even, the touch display 1305 may be further set in anon-rectangular irregular pattern, namely, a special-shaped screen. Thetouch display 1305 may be prepared by using materials such as a liquidcrystal display (LCD), an organic light-emitting diode (OLED), or thelike.

The camera assembly 1306 is configured to acquire an image or a video.Optionally, the camera assembly 1306 includes a front-facing camera anda rear-facing camera. Generally, the front-facing camera is disposed ona front panel of the terminal, and the rear-facing camera is disposed ona back surface of the terminal. In some embodiments, there are at leasttwo rear-facing cameras, which are respectively any one of a maincamera, a depth of field camera, a wide-angle camera, and a telephotocamera, to implement a background blurring function by fusing the maincamera and the depth of field camera, and panoramic shooting and virtualreality (VR) shooting functions or other fusing shooting functions byfusing the main camera and the wide-angle camera. In some embodiments,the camera assembly 1306 may further include a flash. The flash may be asingle color temperature flash, or may be a double color temperatureflash. The double color temperature flash is a combination of a warmlight flash and a cold light flash, and may be used for lightcompensation under different color temperatures.

The audio circuit 1307 may include a microphone and a speaker. Thespeaker is configured to collect sound waves of a user and anenvironment, and convert the sound waves into electric signals and inputthe electrical signals into the processor 1301 for processing, or inputthe electrical signals into the radio frequency circuit 1304 toimplement speech communication. For the purpose of stereo soundcollection or noise reduction, there may be a plurality of microphones,respectively disposed at different parts of the terminal 1300. Themicrophone may be further an array microphone or an omnidirectionalcollection microphone. The speaker is configured to convert electricsignals from the processor 1301 or the radio frequency circuit 1304 intosound waves. The speaker may be a conventional thin-film speaker or apiezoelectric ceramic speaker. In a case that the speaker is thepiezoelectric ceramic speaker, electric signals not only can beconverted into sound waves that can be heard by human, but also can beconverted into sound waves that cannot be heard by human for ranging andthe like. In some embodiments, the audio circuit 1307 may furtherinclude an earphone jack.

The positioning component 1308 is configured to position a currentgeographic location of the terminal 1300, to implement a navigation or alocation based service (LBS). The positioning component 1308 may be apositioning component based on the Global Positioning System (GPS) ofthe United States, the BeiDou system of China, the GLONASS System ofRussia, or the GALILEO System of the European Union.

The power supply 1309 is configured to supply power for variouscomponents in the terminal 1300. The power supply 1309 may be analternating current, a direct current, a disposable battery, or arechargeable battery. When the power supply 1309 includes therechargeable battery, the rechargeable battery may be a wiredrechargeable battery or a wireless rechargeable battery. Therechargeable battery may be further configured to support a fast chargetechnology.

In some embodiments, the terminal 1300 further includes one or moresensors 1310. The one or more sensors 1310 include, but are not limitedto: an acceleration sensor 1311, a gyroscope sensor 1312, a pressuresensor 1313, a fingerprint sensor 1314, an optical sensor 1315, and aproximity sensor 1316.

The acceleration sensor 1311 may detect acceleration on three coordinateaxes of a coordinate system established by the terminal 1300. Forexample, the acceleration sensor 1311 may be configured to detectcomponents of gravity acceleration on the three coordinate axes. Theprocessor 1301 may control, according to a gravity acceleration signalcollected by the acceleration sensor 1311, the touch display 1305 todisplay the user interface in a frame view or a portrait view. Theacceleration sensor 1311 may be further configured to collect game oruser motion data.

The gyroscope sensor 1312 may detect a body direction and a rotationangle of the terminal 1300. The gyroscope sensor 1312 may cooperate withthe acceleration sensor 1311 to collect a 3D action by the user on theterminal 1300. The processor 1301 may implement the following functionsaccording to the data collected by the gyroscope sensor 1312: motionsensing (such as changing the UI according to a tilt operation of theuser), image stabilization at shooting, game control, and inertialnavigation.

The pressure sensor 1313 may be disposed on a side frame of the terminal1300 and/or a lower layer of the display 1305. When the pressure sensor1313 is disposed on the side frame of the terminal 1300, a holdingsignal of the user on the terminal 1300 may be detected. The processor1301 performs left and right hand recognition or a quick operationaccording to the holding signal collected by the pressure sensor 1313.When the pressure sensor 1313 is disposed on the lower layer of thetouch display 1305, the processor 1301 controls an operable control onthe UI according to a pressure operation of the user on the touchdisplay 1305. The operable control includes at least one of a buttoncontrol, a scroll bar control, an icon control and a menu control.

The fingerprint sensor 1314 is configured to collect a fingerprint of auser, and the processor 1301 identifies an identity of the useraccording to the fingerprint collected by the fingerprint sensor 1314,or the fingerprint sensor 1314 identifies an identity of the useraccording to the collected fingerprint. When the identity of the user isidentified as a trusted identity, the processor 1301 authorizes the userto perform a related sensitive operation. The sensitive operationincludes unlocking a screen, viewing encrypted information, downloadingsoftware, payment, changing settings, and the like. The fingerprintsensor 1314 may be disposed on a front surface, a back surface, or aside surface of the terminal 1300. When the terminal 1300 is providedwith a physical button or a vendor logo, the fingerprint sensor 1314 maybe integrated with the physical button or the vendor logo.

The optical sensor 1315 is configured to collect ambient lightintensity. In an embodiment, the processor 1301 may control displaybrightness of the touch display 1305 according to the ambient lightintensity collected by the optical sensor 1315. Specifically, when theambient light intensity is relatively high, the display brightness ofthe touch display 1305 is turned up. When the ambient light intensity isrelatively low, the display brightness of the touch display 1305 isturned down. In another embodiment, the processor 1301 may furtherdynamically adjust a camera parameter of the camera assembly 1306according to the ambient light intensity collected by the optical sensor1315.

The proximity sensor 1316, also referred to as a distance sensor, isusually disposed on the front panel of the terminal 1300. The proximitysensor 1316 is configured to collect a distance between a user and thefront surface of the terminal 1300. In an embodiment, when the proximitysensor 1316 detects that the distance between the user and the frontsurface of the terminal 1300 gradually becomes smaller, the touchdisplay 1305 is controlled by the processor 1301 to switch from ascreen-on state to a screen-off state. In a case that the proximitysensor 1316 detects that the distance between the user and the frontsurface of the terminal 1300 gradually becomes larger, the touch display1305 is controlled by the processor 1301 to switch from the screen-offstate to the screen-on state.

A person skilled in the art may understand that the structure shown inFIG. 13 does not constitute a limitation to the terminal 1300, and theterminal may include more or fewer components than those shown in thefigure, or some components may be combined, or a different componentdeployment may be used.

An embodiment of this disclosure further provides a non-transitorycomputer-readable storage medium. The non-transitory computer-readablestorage medium stores at least one instruction, at least one program, acode set, or an instruction set. The instruction, the program, the codeset, or the instruction set is loaded by a processor and has operationsto implement the method for controlling a virtual object to interactwith a projectile in the foregoing embodiment.

A person of ordinary skill in the art may understand that all or some ofthe steps of the foregoing embodiments may be implemented by usinghardware, or may be implemented by a program instructing relevanthardware. The program may be stored in a computer-readable storagemedium. The above-mentioned storage medium may be a read-only memory, amagnetic disk, an optical disc, and the like.

The foregoing descriptions are merely exemplary embodiments of thisdisclosure, but are not intended to limit this application. Anymodification, equivalent replacement, or improvement made within thespirit and principle of this application shall fall within theprotection scope of this application.

What is claimed is:
 1. A method for controlling a virtual object tointeract with a projectile, applied to a terminal, the methodcomprising: controlling the virtual object to pick up the projectile ina virtual scene; determining a shooting direction of a camera of thevirtual scene as a throwing direction of the projectile; determining amotion trajectory of the projectile according to the initial position,the throwing direction, an initial throwing speed of the projectile, anda motion law of an object under an influence of gravity acceleration, sothat the motion trajectory is a curve conforming to the motion law;displaying, in the virtual scene, the motion trajectory; and in responseto detecting the virtual object being attacked by another virtualobject, controlling the virtual object to automatically throw theprojectile along the motion trajectory.
 2. The method according to claim1, wherein determining the motion trajectory of the projectile accordingto the initial position, the throwing direction, the initial throwingspeed of the projectile, and the motion law of the object under theinfluence of gravity acceleration comprises: determining the motiontrajectory of the projectile using the following formula:$\{ {{{\begin{matrix}{{y = {y_{0} + {v_{0}b\frac{x - x_{0}}{v_{0}a}}}}\mspace{155mu}} \\{z = {z_{0} + {v_{0}c\frac{x - x_{0}}{v_{0}a}} - {\frac{1}{2}{g( \frac{x - x_{0}}{v_{0}a} )}^{2}}}}\end{matrix}{\min( {x_{0},x_{l}} )}} \leq x \leq {\max( {x_{0},x_{l}} )}};} $wherein (x, y, z) represents coordinates of any position in the motiontrajectory, (x₀ , y₀,z₀) represents coordinates of the initial position,(x₁, y₁, z₁) represents coordinates of an end position of the motiontrajectory, (a, b, c) is a unit vector representing the throwingdirection √{square root over (a²+b²c²)}=1, v₀represents the initialthrowing speed, and g represents the gravity acceleration.
 3. The methodaccording to claim 1, further comprising: obtaining a plurality ofpreset moments, a time interval between any two adjacent preset momentsbeing a preset duration; determining a position of the projectile ateach preset moment according to the each of the plurality of presetmoments, the initial position, the throwing direction, the initialthrowing speed, and the motion law; and determining a second position asan end position of the motion trajectory when a first position of theprojectile at a first preset moment is not within an obstacle area ofthe virtual scene, and the second position of the projectile at a secondpreset moment is within the obstacle area of the virtual scene, thesecond preset moment being a next moment of the first preset moment. 4.The method according to claim 3, wherein determining the position of theprojectile at the each preset moment comprises: determining the positionof the projectile at the each of the plurality of preset moments usingthe following formulas:x=x₀+v₀at;y=y₀+v₀bt;z=z₀+v₀ct −½gt²; wherein t represents the each of the plurality ofpreset moments, (x, y, z) represents coordinates of the position of theprojectile at the each of the plurality of preset moments, (x₀, y₀, z₀)represents coordinates of the initial position, (a, b, c) is a unitvector representing the throwing direction, √{square root over(a²+b²+c²)}=1, v₀ represents the initial throwing speed, and grepresents the gravity acceleration.
 5. The method according to claim 1,wherein controlling the virtual object to pick up the projectile in thevirtual scene comprises: displaying, in the virtual scene, a pickupbutton of the projectile; and controlling the virtual object to pick upthe projectile and displaying a dynamic image of the virtual objectpicking up the projectile, in response to detecting a confirmationoperation on the pickup button.
 6. The method according to claim 1,wherein displaying, in the virtual scene, the motion trajectorycomprises: displaying, in the virtual scene, a throw button of theprojectile; and displaying, in the virtual scene, the motion trajectory,in response to detecting a press operation on the throw button.
 7. Themethod according to claim 6, wherein after displaying, in the virtualscene, the motion trajectory, in response to detecting the pressoperation on the throw button, the method further comprises: in responseto detecting a direction adjustment operation, adjusting the shootingdirection of the camera according to the direction adjustment operation,and using an adjusted shooting direction of the camera as an adjustedthrowing direction of the projectile; redetermining the motiontrajectory of the projectile according to the initial position, theadjusted throwing direction, the initial throwing speed, and the motionlaw; and displaying, in the virtual scene, a redetermined motiontrajectory.
 8. The method according to claim 6, wherein afterdisplaying, in the virtual scene, the motion trajectory, in response todetecting the press operation on the throw button, the method furthercomprises: controlling the virtual object to perform a throwingoperation on the projectile and displaying a dynamic image of theprojectile moving to an end position along the motion trajectory, inresponse to detecting a release operation on the throw button.
 9. Anapparatus for controlling a virtual object to interact with aprojectile, comprising a memory for storing computer instructions and aprocessor in communication with the memory, wherein, when the processorexecutes the computer instructions, the processor is configured to causethe apparatus to: control the virtual object to pick up the projectilein a virtual scene; determine a shooting direction of a camera of thevirtual scene as a throwing direction of the projectile; determine amotion trajectory of the projectile according to the initial position,the throwing direction, an initial throwing speed of the projectile, anda motion law of an object under an influence of gravity acceleration, sothat the motion trajectory is a curve conforming to the motion law;display, in the virtual scene, the motion trajectory; and in response todetecting the virtual object being attacked by another virtual object,control the virtual object to automatically throw the projectile alongthe motion trajectory.
 10. The apparatus according to claim 9, wherein,when the processor is configured to cause the apparatus to determine themotion trajectory of the projectile according to the initial position,the throwing direction, the initial throwing speed of the projectile,and the motion law of the object under the influence of gravityacceleration, the processor is configured to cause the apparatus to:determine the motion trajectory of the projectile using the followingformula: $\{ {{{\begin{matrix}{{y = {y_{0} + {v_{0}b\frac{x - x_{0}}{v_{0}a}}}}\mspace{155mu}} \\{z = {z_{0} + {v_{0}c\frac{x - x_{0}}{v_{0}a}} - {\frac{1}{2}{g( \frac{x - x_{0}}{v_{0}a} )}^{2}}}}\end{matrix}{\min( {x_{0},x_{l}} )}} \leq x \leq {\max( {x_{0},x_{l}} )}};} $wherein (x, y, z) represents coordinates of any position in the motiontrajectory, (x₀, y₀, z₀) represents coordinates of the initial position,(x₁, .y₁, z₁) represents coordinates of an end position of the motiontrajectory, (a, b, c) is a unit vector representing the throwingdirection, √{square root over (a²+b²+c²)}=1, v₀ represents the initialthrowing speed, and g represents the gravity acceleration.
 11. Theapparatus according to claim 9, wherein, when the processor executes thecomputer instructions, the processor is configured to further cause theapparatus to: obtain a plurality of preset moments, a time intervalbetween any two adjacent preset moments being a preset duration;determine a position of the projectile at each preset moment accordingto the each of the plurality of preset moments, the initial position,the throwing direction, the initial throwing speed, and the motion law;and determine a second position as an end position of the motiontrajectory when a first position of the projectile at a first presetmoment is not within an obstacle area of the virtual scene, and thesecond position of the projectile at a second preset moment is withinthe obstacle area of the virtual scene, the second preset moment being anext moment of the first preset moment.
 12. The apparatus according toclaim 11, wherein, when the processor is configured to cause theapparatus to determine the position of the projectile at the each presetmoment, the processor is configured to cause the apparatus to: determinethe position of the projectile at the each of the plurality of presetmoments using the following formulas:x=x₀+v₀at;y=y₀+v₀bt;z=z₀+v₀ct− 1/2 gt²; wherein t represents the each of the plurality ofpreset moments, (x, y, z) represents coordinates of the position of theprojectile at the each of the plurality of preset moments, (x₀, y₀, z₀)represents coordinates of the initial position, (a, b, c) is a unitvector representing the throwing direction, √{square root over(a²+b²+c²)}=1, v₀ represents the initial throwing speed, and grepresents the gravity acceleration.
 13. The apparatus according toclaim 9, wherein, when the processor is configured to cause theapparatus to control the virtual object to pick up the projectile in thevirtual scene, the processor is configured to cause the apparatus to:display, in the virtual scene, a pickup button of the projectile; andcontrol the virtual object to pick up the projectile and displaying adynamic image of the virtual object picking up the projectile, inresponse to detecting a confirmation operation on the pickup button. 14.The apparatus according to claim 9, wherein, when the processor isconfigured to cause the apparatus to display, in the virtual scene, themotion trajectory, the processor is configured to cause the apparatusto: display, in the virtual scene, a throw button of the projectile; anddisplay, in the virtual scene, the motion trajectory, in response todetecting a press operation on the throw button.
 15. The apparatusaccording to claim 14, wherein, after the processor is configured tocause the apparatus to display, in the virtual scene, the motiontrajectory, in response to detecting the press operation on the throwbutton, the processor is configured to further cause the apparatus to:in response to detecting a direction adjustment operation, adjust theshooting direction of the camera according to the direction adjustmentoperation, and use an adjusted shooting direction of the camera as anadjusted throwing direction of the projectile; redetermine the motiontrajectory of the projectile according to the initial position, theadjusted throwing direction, the initial throwing speed, and the motionlaw; and display, in the virtual scene, a redetermined motiontrajectory.
 16. The apparatus according to claim 14, wherein, after theprocessor is configured to cause the apparatus to display, in thevirtual scene, the motion trajectory, in response to detecting the pressoperation on the throw button, the processor is configured to furthercause the apparatus to: control the virtual object to perform a throwingoperation on the projectile and display a dynamic image of theprojectile moving to an end position along the motion trajectory, inresponse to detecting a release operation on the throw button.
 17. Anon-transitory storage medium for storing computer readableinstructions, the computer readable instructions, when executed by aprocessor, causing the processor to: control a virtual object to pick upa projectile in a virtual scene; determine a shooting direction of acamera of the virtual scene as a throwing direction of the projectile;determine a motion trajectory of the projectile according to the initialposition, the throwing direction, an initial throwing speed of theprojectile, and a motion law of an object under an influence of gravityacceleration, so that the motion trajectory is a curve conforming to themotion law; display, in the virtual scene, the motion trajectory; and inresponse to detecting the virtual object being attacked by anothervirtual object, control the virtual object to automatically throw theprojectile along the motion trajectory.
 18. The non-transitory storagemedium according to claim 17, wherein, when computer readableinstructions cause the processor to determine the motion trajectory ofthe projectile according to the initial position, the throwingdirection, the initial throwing speed of the projectile, and the motionlaw of the object under the influence of gravity acceleration, thecomputer readable instructions cause the processor to: determine themotion trajectory of the projectile using the following formula:$\{ {{{\begin{matrix}{{y = {y_{0} + {v_{0}b\frac{x - x_{0}}{v_{0}a}}}}\mspace{155mu}} \\{z = {z_{0} + {v_{0}c\frac{x - x_{0}}{v_{0}a}} - {\frac{1}{2}{g( \frac{x - x_{0}}{v_{0}a} )}^{2}}}}\end{matrix}{\min( {x_{0},x_{l}} )}} \leq x \leq {\max( {x_{0},x_{l}} )}};} $wherein (x, y, z) represents coordinates of any position in the motiontrajectory, (x₀, y₀,z₀) represents coordinates of the initial position,(x₁, y₁, z₁) represents coordinates of an end position of the motiontrajectory, (a, b, c) is a unit vector representing the throwingdirection √{square root over (a²+b²+c²)}=1, v₀ represents the initialthrowing speed, and g represents the gravity acceleration.
 19. Thenon-transitory storage medium according to claim 17, wherein, thecomputer readable instructions further cause the processor to: obtain aplurality of preset moments, a time interval between any two adjacentpreset moments being a preset duration; determine a position of theprojectile at each preset moment according to the each of the pluralityof preset moments, the initial position, the throwing direction, theinitial throwing speed, and the motion law; and determine a secondposition as an end position of the motion trajectory when a firstposition of the projectile at a first preset moment is not within anobstacle area of the virtual scene, and the second position of theprojectile at a second preset moment is within the obstacle area of thevirtual scene, the second preset moment being a next moment of the firstpreset moment.
 20. The non-transitory storage medium according to claim19, wherein, when computer readable instructions cause the processor todetermine the position of the projectile at the each preset moment, thecomputer readable instructions cause the processor to: determine theposition of the projectile at the each of the plurality of presetmoments using the following formulas:x=x₀+v₀at;y=y₀+v₀bt;z=z₀+v₀ct− 1/2 gt²; wherein t represents the each of the plurality ofpreset moments, (x, y, z) represents coordinates of the position of theprojectile at the each of the plurality of preset moments, (x₀, y₀, z₀)represents coordinates of the initial position, (a, b, c) is a unitvector representing the throwing direction, √{square root over(a²+b²+c²)}=1, v₀ represents the initial throwing speed, and grepresents the gravity acceleration.